//
//  TimeRecord.swift
//  XingCeHelper
//
//  Created by 申铭 on 2022/9/1.
//

import Foundation

private let kSpace = "      "

struct TimeRecord {
    var title: String = ""
    /// 时间
    var timeStr: String = ""
    /// 秒数
    var seconds: Int = 0
    /// 总秒数
    var totalSeconds: Int = 0
    
    func getResultStr() -> String {
        if timeStr == "" {
            return "\(title)：\n [区间\(kSpace)\(seconds.toSecondStr())] \n [共计\(kSpace)\(totalSeconds.toSecondStr())]"
        }
        return "\(title)：\n [时间\(kSpace)\(timeStr)] \n [区间\(kSpace)\(seconds.toSecondStr())] \n [共计\(kSpace)\(totalSeconds.toSecondStr())]"
    }
}
